package com.industrial.premu.controller;

import cn.hutool.core.util.ArrayUtil;
import com.industrial.common.core.web.domain.AjaxResult;
import com.industrial.common.security.utils.SecurityUtils;
import com.industrial.premu.domain.PreMuDifferentiationPolicy;
import com.industrial.premu.service.IDifferentiationPolicyAnalysisService;
import com.industrial.system.api.domain.SysUser;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;
import java.util.Set;

@RestController
@RequestMapping("/policy/analysis")
public class DifferentiationPolicyAnalysisController {

    @Autowired
    private IDifferentiationPolicyAnalysisService differentiationPolicyAnalysisService;

    /**
     * <p>
     *     查询差别化政策标签数量分布数量
     * </p>
     * @return
     */
    @GetMapping("/queryPolicyCount")
    public AjaxResult queryPolicyCount(PreMuDifferentiationPolicy params){

        Set<String> sysRoles = SecurityUtils.getLoginUser().getRoles();
        SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();

        if(ArrayUtil.contains(sysRoles.toArray(),"x_01_011")){
            if(StringUtils.isBlank(params.getReleaseCity())){
                params.setReleaseCounty(sysUser.getDistrict());
            }else{
                params.setReleaseCounty(params.getReleaseCity());
                params.setReleaseCity(null);
            }
            params.setReleaseCity(null);
        }else if(ArrayUtil.contains(sysRoles.toArray(),"s_01_011")){
            if(StringUtils.isBlank(params.getReleaseCity())){
                params.setReleaseCity(sysUser.getCity());
            }else{
                if(StringUtils.endsWith(params.getReleaseCity(),"0000")){
                    params.setReleaseProvince(params.getReleaseCity());
                    params.setReleaseCity(null);
                }else if(StringUtils.endsWith(params.getReleaseCity(),"00")){
                    params.setReleaseCity(params.getReleaseCity());
                }else{
                    params.setReleaseCounty(params.getReleaseCity());
                    params.setReleaseCity(null);
                }
            }
        }else if(ArrayUtil.contains(sysRoles.toArray(),"p_01_011")){
            if(StringUtils.isBlank(params.getReleaseCity())){
                params.setReleaseProvince(sysUser.getProvince());
            }else{
                if(StringUtils.endsWith(params.getReleaseCity(),"0000")){
                    params.setReleaseProvince(params.getReleaseCity());
                    params.setReleaseCity(null);
                }else if(StringUtils.endsWith(params.getReleaseCity(),"00")){
                    params.setReleaseCity(params.getReleaseCity());
                }else{
                    params.setReleaseCounty(params.getReleaseCity());
                    params.setReleaseCity(null);
                }
            }
        }
        List<Map<String, Object>> maps = differentiationPolicyAnalysisService.queryPolicyCount(params);
        return AjaxResult.success(maps);
    }

    /**
     * 各地市差别化政策适用评价等级比对
     * @return
     */
    @GetMapping("/queryPolicyLevel")
    public AjaxResult queryPolicyLevel(PreMuDifferentiationPolicy params){

        Set<String> sysRoles = SecurityUtils.getLoginUser().getRoles();
        SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();

        if(ArrayUtil.contains(sysRoles.toArray(),"x_01_011")){
            if(StringUtils.isBlank(params.getReleaseCity())){
                params.setReleaseCounty(sysUser.getDistrict());
            }else{
                params.setReleaseCounty(params.getReleaseCity());
                params.setReleaseCity(null);
            }
            params.setReleaseCity(null);
        }else if(ArrayUtil.contains(sysRoles.toArray(),"s_01_011")){
            if(StringUtils.isBlank(params.getReleaseCity())){
                params.setReleaseCity(sysUser.getCity());
            }else{
                if(StringUtils.endsWith(params.getReleaseCity(),"0000")){
                    params.setReleaseProvince(params.getReleaseCity());
                    params.setReleaseCity(null);
                }else if(StringUtils.endsWith(params.getReleaseCity(),"00")){
                    params.setReleaseCity(params.getReleaseCity());
                }else{
                    params.setReleaseCounty(params.getReleaseCity());
                    params.setReleaseCity(null);
                }
            }
        }else if(ArrayUtil.contains(sysRoles.toArray(),"p_01_011")){
            if(StringUtils.isBlank(params.getReleaseCity())){
                params.setReleaseProvince(sysUser.getProvince());
            }else{
                if(StringUtils.endsWith(params.getReleaseCity(),"0000")){
                    params.setReleaseProvince(params.getReleaseCity());
                    params.setReleaseCity(null);
                }else if(StringUtils.endsWith(params.getReleaseCity(),"00")){
                    params.setReleaseCity(params.getReleaseCity());
                }else{
                    params.setReleaseCounty(params.getReleaseCity());
                    params.setReleaseCity(null);
                }
            }
        }else{
            params.setReleaseProvince("370000");
        }
        Map<String,Object> result = differentiationPolicyAnalysisService.queryPolicyLevel(params);
        return AjaxResult.success(result);
    }

    /**
     * 各部门差别化政策发布土地使用税数量分析
     * @param params
     * @return
     */
    @GetMapping("/queryPolicyTdSysCount")
    public AjaxResult queryPolicyTdSysCount(PreMuDifferentiationPolicy params){
        Set<String> sysRoles = SecurityUtils.getLoginUser().getRoles();
        SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();

        if(ArrayUtil.contains(sysRoles.toArray(),"x_01_011")){
            if(StringUtils.isBlank(params.getReleaseCity())){
                params.setReleaseCounty(sysUser.getDistrict());
            }else{
                params.setReleaseCounty(params.getReleaseCity());
                params.setReleaseCity(null);
            }
            params.setReleaseCity(null);
        }else if(ArrayUtil.contains(sysRoles.toArray(),"s_01_011")){
            if(StringUtils.isBlank(params.getReleaseCity())){
                params.setReleaseCity(sysUser.getCity());
            }else{
                if(StringUtils.endsWith(params.getReleaseCity(),"0000")){
                    params.setReleaseProvince(params.getReleaseCity());
                    params.setReleaseCity(null);
                }else if(StringUtils.endsWith(params.getReleaseCity(),"00")){
                    params.setReleaseCity(params.getReleaseCity());
                }else{
                    params.setReleaseCounty(params.getReleaseCity());
                    params.setReleaseCity(null);
                }
            }
        }else if(ArrayUtil.contains(sysRoles.toArray(),"p_01_011")){
            if(StringUtils.isBlank(params.getReleaseCity())){
                params.setReleaseProvince(sysUser.getProvince());
            }else{
                if(StringUtils.endsWith(params.getReleaseCity(),"0000")){
                    params.setReleaseProvince(params.getReleaseCity());
                    params.setReleaseCity(null);
                }else if(StringUtils.endsWith(params.getReleaseCity(),"00")){
                    params.setReleaseCity(params.getReleaseCity());
                }else{
                    params.setReleaseCounty(params.getReleaseCity());
                    params.setReleaseCity(null);
                }
            }
        }else{
            params.setReleaseProvince("370000");
        }
        return differentiationPolicyAnalysisService.queryPolicyTdSysCount(params);
    }

    /**
     * 各部门差别化政策发布土地供应数量分析
     * @param params
     * @return
     */
    @GetMapping("/queryPolicyTdGyCount")
    public AjaxResult queryPolicyTdGyCount(PreMuDifferentiationPolicy params){
        Set<String> sysRoles = SecurityUtils.getLoginUser().getRoles();
        SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();

        if(ArrayUtil.contains(sysRoles.toArray(),"x_01_011")){
            if(StringUtils.isBlank(params.getReleaseCity())){
                params.setReleaseCounty(sysUser.getDistrict());
            }else{
                params.setReleaseCounty(params.getReleaseCity());
                params.setReleaseCity(null);
            }
            params.setReleaseCity(null);
        }else if(ArrayUtil.contains(sysRoles.toArray(),"s_01_011")){
            if(StringUtils.isBlank(params.getReleaseCity())){
                params.setReleaseCity(sysUser.getCity());
            }else{
                if(StringUtils.endsWith(params.getReleaseCity(),"0000")){
                    params.setReleaseProvince(params.getReleaseCity());
                    params.setReleaseCity(null);
                }else if(StringUtils.endsWith(params.getReleaseCity(),"00")){
                    params.setReleaseCity(params.getReleaseCity());
                }else{
                    params.setReleaseCounty(params.getReleaseCity());
                    params.setReleaseCity(null);
                }
            }
        }else if(ArrayUtil.contains(sysRoles.toArray(),"p_01_011")){
            if(StringUtils.isBlank(params.getReleaseCity())){
                params.setReleaseProvince(sysUser.getProvince());
            }else{
                if(StringUtils.endsWith(params.getReleaseCity(),"0000")){
                    params.setReleaseProvince(params.getReleaseCity());
                    params.setReleaseCity(null);
                }else if(StringUtils.endsWith(params.getReleaseCity(),"00")){
                    params.setReleaseCity(params.getReleaseCity());
                }else{
                    params.setReleaseCounty(params.getReleaseCity());
                    params.setReleaseCity(null);
                }
            }
        }else{
            params.setReleaseProvince("370000");
        }
        return differentiationPolicyAnalysisService.queryPolicyTdGyCount(params);
    }

    /**
     * 各部门差别化政策发布排污权收费数量分析
     * @param params
     * @return
     */
    @GetMapping("/queryPolicyPwqsfCount")
    public AjaxResult queryPolicyPwqsfCount(PreMuDifferentiationPolicy params){
        Set<String> sysRoles = SecurityUtils.getLoginUser().getRoles();
        SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();

        if(ArrayUtil.contains(sysRoles.toArray(),"x_01_011")){
            if(StringUtils.isBlank(params.getReleaseCity())){
                params.setReleaseCounty(sysUser.getDistrict());
            }else{
                params.setReleaseCounty(params.getReleaseCity());
                params.setReleaseCity(null);
            }
            params.setReleaseCity(null);
        }else if(ArrayUtil.contains(sysRoles.toArray(),"s_01_011")){
            if(StringUtils.isBlank(params.getReleaseCity())){
                params.setReleaseCity(sysUser.getCity());
            }else{
                if(StringUtils.endsWith(params.getReleaseCity(),"0000")){
                    params.setReleaseProvince(params.getReleaseCity());
                    params.setReleaseCity(null);
                }else if(StringUtils.endsWith(params.getReleaseCity(),"00")){
                    params.setReleaseCity(params.getReleaseCity());
                }else{
                    params.setReleaseCounty(params.getReleaseCity());
                    params.setReleaseCity(null);
                }
            }
        }else if(ArrayUtil.contains(sysRoles.toArray(),"p_01_011")){
            if(StringUtils.isBlank(params.getReleaseCity())){
                params.setReleaseProvince(sysUser.getProvince());
            }else{
                if(StringUtils.endsWith(params.getReleaseCity(),"0000")){
                    params.setReleaseProvince(params.getReleaseCity());
                    params.setReleaseCity(null);
                }else if(StringUtils.endsWith(params.getReleaseCity(),"00")){
                    params.setReleaseCity(params.getReleaseCity());
                }else{
                    params.setReleaseCounty(params.getReleaseCity());
                    params.setReleaseCity(null);
                }
            }
        }else{
            params.setReleaseProvince("370000");
        }
        return differentiationPolicyAnalysisService.queryPolicyPwqsfCount(params);
    }


    /**
     * 各部门差别化政策发布水价数量分析
     * @param params
     * @return
     */
    @GetMapping("/queryPolicySjCount")
    public AjaxResult queryPolicySjCount(PreMuDifferentiationPolicy params){
        Set<String> sysRoles = SecurityUtils.getLoginUser().getRoles();
        SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();

        if(ArrayUtil.contains(sysRoles.toArray(),"x_01_011")){
            if(StringUtils.isBlank(params.getReleaseCity())){
                params.setReleaseCounty(sysUser.getDistrict());
            }else{
                params.setReleaseCounty(params.getReleaseCity());
                params.setReleaseCity(null);
            }
            params.setReleaseCity(null);
        }else if(ArrayUtil.contains(sysRoles.toArray(),"s_01_011")){
            if(StringUtils.isBlank(params.getReleaseCity())){
                params.setReleaseCity(sysUser.getCity());
            }else{
                if(StringUtils.endsWith(params.getReleaseCity(),"0000")){
                    params.setReleaseProvince(params.getReleaseCity());
                    params.setReleaseCity(null);
                }else if(StringUtils.endsWith(params.getReleaseCity(),"00")){
                    params.setReleaseCity(params.getReleaseCity());
                }else{
                    params.setReleaseCounty(params.getReleaseCity());
                    params.setReleaseCity(null);
                }
            }
        }else if(ArrayUtil.contains(sysRoles.toArray(),"p_01_011")){
            if(StringUtils.isBlank(params.getReleaseCity())){
                params.setReleaseProvince(sysUser.getProvince());
            }else{
                if(StringUtils.endsWith(params.getReleaseCity(),"0000")){
                    params.setReleaseProvince(params.getReleaseCity());
                    params.setReleaseCity(null);
                }else if(StringUtils.endsWith(params.getReleaseCity(),"00")){
                    params.setReleaseCity(params.getReleaseCity());
                }else{
                    params.setReleaseCounty(params.getReleaseCity());
                    params.setReleaseCity(null);
                }
            }
        }else{
            params.setReleaseProvince("370000");
        }
        return differentiationPolicyAnalysisService.queryPolicySjCount(params);
    }

    /**
     * 各部门差别化政策发布水价数量分析
     * @param params
     * @return
     */
    @GetMapping("/queryPolicyQjCount")
    public AjaxResult queryPolicyQjCount(PreMuDifferentiationPolicy params){
        Set<String> sysRoles = SecurityUtils.getLoginUser().getRoles();
        SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();

        if(ArrayUtil.contains(sysRoles.toArray(),"x_01_011")){
            if(StringUtils.isBlank(params.getReleaseCity())){
                params.setReleaseCounty(sysUser.getDistrict());
            }else{
                params.setReleaseCounty(params.getReleaseCity());
                params.setReleaseCity(null);
            }
            params.setReleaseCity(null);
        }else if(ArrayUtil.contains(sysRoles.toArray(),"s_01_011")){
            if(StringUtils.isBlank(params.getReleaseCity())){
                params.setReleaseCity(sysUser.getCity());
            }else{
                if(StringUtils.endsWith(params.getReleaseCity(),"0000")){
                    params.setReleaseProvince(params.getReleaseCity());
                    params.setReleaseCity(null);
                }else if(StringUtils.endsWith(params.getReleaseCity(),"00")){
                    params.setReleaseCity(params.getReleaseCity());
                }else{
                    params.setReleaseCounty(params.getReleaseCity());
                    params.setReleaseCity(null);
                }
            }
        }else if(ArrayUtil.contains(sysRoles.toArray(),"p_01_011")){
            if(StringUtils.isBlank(params.getReleaseCity())){
                params.setReleaseProvince(sysUser.getProvince());
            }else{
                if(StringUtils.endsWith(params.getReleaseCity(),"0000")){
                    params.setReleaseProvince(params.getReleaseCity());
                    params.setReleaseCity(null);
                }else if(StringUtils.endsWith(params.getReleaseCity(),"00")){
                    params.setReleaseCity(params.getReleaseCity());
                }else{
                    params.setReleaseCounty(params.getReleaseCity());
                    params.setReleaseCity(null);
                }
            }
        }else{
            params.setReleaseProvince("370000");
        }
        return differentiationPolicyAnalysisService.queryPolicyQjCount(params);
    }

    /**
     * 各部门差别化政策发布水价数量分析
     * @param params
     * @return
     */
    @GetMapping("/queryPolicyDjCount")
    public AjaxResult queryPolicyDjCount(PreMuDifferentiationPolicy params){
        Set<String> sysRoles = SecurityUtils.getLoginUser().getRoles();
        SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();

        if(ArrayUtil.contains(sysRoles.toArray(),"x_01_011")){
            if(StringUtils.isBlank(params.getReleaseCity())){
                params.setReleaseCounty(sysUser.getDistrict());
            }else{
                params.setReleaseCounty(params.getReleaseCity());
                params.setReleaseCity(null);
            }
            params.setReleaseCity(null);
        }else if(ArrayUtil.contains(sysRoles.toArray(),"s_01_011")){
            if(StringUtils.isBlank(params.getReleaseCity())){
                params.setReleaseCity(sysUser.getCity());
            }else{
                if(StringUtils.endsWith(params.getReleaseCity(),"0000")){
                    params.setReleaseProvince(params.getReleaseCity());
                    params.setReleaseCity(null);
                }else if(StringUtils.endsWith(params.getReleaseCity(),"00")){
                    params.setReleaseCity(params.getReleaseCity());
                }else{
                    params.setReleaseCounty(params.getReleaseCity());
                    params.setReleaseCity(null);
                }
            }
        }else if(ArrayUtil.contains(sysRoles.toArray(),"p_01_011")){
            if(StringUtils.isBlank(params.getReleaseCity())){
                params.setReleaseProvince(sysUser.getProvince());
            }else{
                if(StringUtils.endsWith(params.getReleaseCity(),"0000")){
                    params.setReleaseProvince(params.getReleaseCity());
                    params.setReleaseCity(null);
                }else if(StringUtils.endsWith(params.getReleaseCity(),"00")){
                    params.setReleaseCity(params.getReleaseCity());
                }else{
                    params.setReleaseCounty(params.getReleaseCity());
                    params.setReleaseCity(null);
                }
            }
        }else{
            params.setReleaseProvince("370000");
        }
        return differentiationPolicyAnalysisService.queryPolicyDjCount(params);
    }

    /**
     * 各部门差别化政策发布政府性资金数量分析
     * @param params
     * @return
     */
    @GetMapping("/queryPolicyZfxzjCount")
    public AjaxResult queryPolicyZfxzjCount(PreMuDifferentiationPolicy params){
        Set<String> sysRoles = SecurityUtils.getLoginUser().getRoles();
        SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();

        if(ArrayUtil.contains(sysRoles.toArray(),"x_01_011")){
            if(StringUtils.isBlank(params.getReleaseCity())){
                params.setReleaseCounty(sysUser.getDistrict());
            }else{
                params.setReleaseCounty(params.getReleaseCity());
                params.setReleaseCity(null);
            }
            params.setReleaseCity(null);
        }else if(ArrayUtil.contains(sysRoles.toArray(),"s_01_011")){
            if(StringUtils.isBlank(params.getReleaseCity())){
                params.setReleaseCity(sysUser.getCity());
            }else{
                if(StringUtils.endsWith(params.getReleaseCity(),"0000")){
                    params.setReleaseProvince(params.getReleaseCity());
                    params.setReleaseCity(null);
                }else if(StringUtils.endsWith(params.getReleaseCity(),"00")){
                    params.setReleaseCity(params.getReleaseCity());
                }else{
                    params.setReleaseCounty(params.getReleaseCity());
                    params.setReleaseCity(null);
                }
            }
        }else if(ArrayUtil.contains(sysRoles.toArray(),"p_01_011")){
            if(StringUtils.isBlank(params.getReleaseCity())){
                params.setReleaseProvince(sysUser.getProvince());
            }else{
                if(StringUtils.endsWith(params.getReleaseCity(),"0000")){
                    params.setReleaseProvince(params.getReleaseCity());
                    params.setReleaseCity(null);
                }else if(StringUtils.endsWith(params.getReleaseCity(),"00")){
                    params.setReleaseCity(params.getReleaseCity());
                }else{
                    params.setReleaseCounty(params.getReleaseCity());
                    params.setReleaseCity(null);
                }
            }
        }else{
            params.setReleaseProvince("370000");
        }
        return differentiationPolicyAnalysisService.queryPolicyZfxzjCount(params);
    }
    /**
     * 各部门差别化政策发布数量分析
     * @param params
     * @return
     */
    @GetMapping("/queryPolicyDeptCount")
    public AjaxResult queryPolicyDeptCount(PreMuDifferentiationPolicy params){
        Set<String> sysRoles = SecurityUtils.getLoginUser().getRoles();
        SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();

        if(ArrayUtil.contains(sysRoles.toArray(),"x_01_011")){
            if(StringUtils.isBlank(params.getReleaseCity())){
                params.setReleaseCounty(sysUser.getDistrict());
            }else{
                params.setReleaseCounty(params.getReleaseCity());
                params.setReleaseCity(null);
            }
            params.setReleaseCity(null);
        }else if(ArrayUtil.contains(sysRoles.toArray(),"s_01_011")){
            if(StringUtils.isBlank(params.getReleaseCity())){
                params.setReleaseCity(sysUser.getCity());
            }else{
                if(StringUtils.endsWith(params.getReleaseCity(),"0000")){
                    params.setReleaseProvince(params.getReleaseCity());
                    params.setReleaseCity(null);
                }else if(StringUtils.endsWith(params.getReleaseCity(),"00")){
                    params.setReleaseCity(params.getReleaseCity());
                }else{
                    params.setReleaseCounty(params.getReleaseCity());
                    params.setReleaseCity(null);
                }
            }
        }else if(ArrayUtil.contains(sysRoles.toArray(),"p_01_011")){
            if(StringUtils.isBlank(params.getReleaseCity())){
                params.setReleaseProvince(sysUser.getProvince());
            }else{
                if(StringUtils.endsWith(params.getReleaseCity(),"0000")){
                    params.setReleaseProvince(params.getReleaseCity());
                    params.setReleaseCity(null);
                }else if(StringUtils.endsWith(params.getReleaseCity(),"00")){
                    params.setReleaseCity(params.getReleaseCity());
                }else{
                    params.setReleaseCounty(params.getReleaseCity());
                    params.setReleaseCity(null);
                }
            }
        }
        Map<String,Object> result = differentiationPolicyAnalysisService.queryPolicyDeptCount(params);
        return AjaxResult.success(result);
    }

    /**
     * <p>
     *     差别化政策近5年发布数量趋势分析
     * </p>
     * @return
     */
    @GetMapping("/queryFiveData")
    public AjaxResult queryFiveData(PreMuDifferentiationPolicy params){

        if(StringUtils.isBlank(params.getYears())){
            return AjaxResult.warn("请传入年份");
        }



        Set<String> sysRoles = SecurityUtils.getLoginUser().getRoles();
        SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();

        if(sysUser.isAdmin()){
            if(StringUtils.isBlank(params.getReleaseCity())){
                params.setReleaseProvince("370000");
            }else{
                if(StringUtils.endsWith(params.getReleaseCity(),"0000")){
                    params.setReleaseProvince(params.getReleaseCity());
                    params.setReleaseCity(null);
                }else if(StringUtils.endsWith(params.getReleaseCity(),"00")){
                    params.setReleaseCity(params.getReleaseCity());
                }else{
                    params.setReleaseCounty(params.getReleaseCity());
                    params.setReleaseCity(null);
                }
            }
        }else{
            if(ArrayUtil.contains(sysRoles.toArray(),"x_01_011")){
                if(StringUtils.isBlank(params.getReleaseCity())){
                    params.setReleaseCounty(sysUser.getDistrict());
                }else{
                    params.setReleaseCounty(params.getReleaseCity());
                    params.setReleaseCity(null);
                }
                params.setReleaseCity(null);
            }else if(ArrayUtil.contains(sysRoles.toArray(),"s_01_011")){
                if(StringUtils.isBlank(params.getReleaseCity())){
                    params.setReleaseCity(sysUser.getCity());
                }else{
                    if(StringUtils.endsWith(params.getReleaseCity(),"0000")){
                        params.setReleaseProvince(params.getReleaseCity());
                        params.setReleaseCity(null);
                    }else if(StringUtils.endsWith(params.getReleaseCity(),"00")){
                        params.setReleaseCity(params.getReleaseCity());
                    }else{
                        params.setReleaseCounty(params.getReleaseCity());
                        params.setReleaseCity(null);
                    }
                }
            }else if(ArrayUtil.contains(sysRoles.toArray(),"p_01_011")){
                if(StringUtils.isBlank(params.getReleaseCity())){
                    params.setReleaseProvince(sysUser.getProvince());
                }else{
                    if(StringUtils.endsWith(params.getReleaseCity(),"0000")){
                        params.setReleaseProvince(params.getReleaseCity());
                        params.setReleaseCity(null);
                    }else if(StringUtils.endsWith(params.getReleaseCity(),"00")){
                        params.setReleaseCity(params.getReleaseCity());
                    }else{
                        params.setReleaseCounty(params.getReleaseCity());
                        params.setReleaseCity(null);
                    }
                }
            }
        }
        Map<String,Object> result = differentiationPolicyAnalysisService.queryFiveData(params);
        return AjaxResult.success(result);
    }
}
